package com.zhang.boot.web.config;


//import com.alibaba.csp.sentinel.adapter.spring.webmvc.callback.BlockExceptionHandler;
import org.springframework.context.annotation.Configuration;

/**
 * @Author zhangshaobin
 * @Date 2020/10/25
 * @Description sentinel配置
 */
@Configuration
public class SentinelConfig {

    /**
     * 设置自定义熔断降级响应
     *
     * @return
     */
    /*@Bean
    public BlockExceptionHandler sentinelBlockExceptionHandler() {
        return (request, response, e) -> {
            // 429 Too Many Requests
            response.setStatus(429);
            PrintWriter out = response.getWriter();
            out.print("Oops, blocked by Sentinel: " + e.getClass().getSimpleName());
            out.flush();
            out.close();
        };
    }*/
}
